home *** CD-ROM | disk | FTP | other *** search
/ Mac Easy 2010 May / Mac Life Ubuntu.iso / casper / filesystem.squashfs / var / lib / dpkg / info / python-gst0.10.prerm < prev    next >
Encoding:
Text File  |  2009-02-21  |  1.5 KB  |  70 lines

  1. #!/bin/sh
  2.  
  3. set -e
  4.  
  5. PYTHON_DEFAULT=$(pyversions --default)
  6.  
  7. this="python-gst0.10"
  8.  
  9. pc_files() {
  10.     runtime="$1"
  11.  
  12.     dpkg -L "$this" | sed -n -e "s#^/usr/lib/pkgconfig/$runtime/##p"
  13. }
  14.  
  15. if [ "$1" = "remove" ]; then
  16.     cd /usr/lib/pkgconfig
  17.  
  18.     for f in $(pc_files $PYTHON_DEFAULT); do
  19.         rm -f "$f"
  20.     done
  21. fi
  22.  
  23. # Automatically added by dh_pycentral
  24. case "$1" in remove|upgrade)
  25.     pkgremove=y
  26. esac
  27. if [ -f /var/lib/pycentral/python-gst0.10.pkgremove ] || [ -f /var/lib/pycentral/pkgremove ]; then
  28.     pkgremove=y
  29. fi
  30. if [ "$pkgremove" = y ]; then
  31. if which python >/dev/null 2>&1 && which pycentral >/dev/null 2>&1; then
  32.     pycentral pkgremove python-gst0.10
  33. else
  34.     flist=$(tempfile)
  35.     slist=$(tempfile)
  36.     dpkg -L python-gst0.10 | tee $flist | \
  37.     while read n; do
  38.       case "$n" in
  39.         /usr/share/pyshared/*)
  40.           n2=${n#/usr/share/pyshared/*}
  41.           case "$n" in
  42.         *.py) echo "p $n";;
  43.         *) [ -d "$n" ] && echo "d $n2" || echo "f $n2"
  44.           esac
  45.           ;;
  46.         *) continue
  47.       esac
  48.     done > $slist
  49.     if [ -s $slist ]; then
  50.         for d in /usr/lib/python[0-9].[0-9]/????-packages; do
  51.         case "$d" in */python2.1/*|*/python2.2/*) continue; esac
  52.         while read t n; do
  53.             case "$t" in
  54.             p) rm -f $d/$n $d/${n}[co];;
  55.             d) rmdir $d/$n 2>/dev/null || true;;
  56.             *) rm -f $d/$n
  57.             esac
  58.         done < $slist
  59.         done
  60.     fi
  61.         awk '/\/usr\/share\/pyshared/ {next} /\.py$/ {print $0"c\n" $0"o"}' $flist \
  62.         | xargs -r rm -f >&2
  63.     rm -f $flist $slist
  64. fi
  65. rm -f /var/lib/pycentral/python-gst0.10.pkgremove
  66. fi
  67. # End automatically added section
  68.  
  69.  
  70.